package com.xc.xcoj.judge.codesandbox;

import com.xc.xcoj.judge.codesandbox.model.ExecuteCodeRequest;
import com.xc.xcoj.judge.codesandbox.model.ExecuteCodeResponse;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;

/**
 * @author zqx
 * @since 2024/10/20
 */
@Slf4j
//@AllArgsConstructor 这里也可以使用 这个注解 代替构造器
public class CodeSandboxProxy implements CodeSandbox{

    private final CodeSandbox codeSandbox;

    public CodeSandboxProxy (CodeSandbox codeSandbox){
        this.codeSandbox = codeSandbox;
    }

    @Override
    public ExecuteCodeResponse executeCode(ExecuteCodeRequest executeCodeRequest) {
        log.info("代码沙箱 开始调用！！");
        ExecuteCodeResponse executeCodeResponse = codeSandbox.executeCode(executeCodeRequest);
        log.info("代码沙箱 调用结束");
        return executeCodeResponse;
    }

    @Override
    public String CodeSandboxType() {
        return null;
    }
}
